home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.0 / stk-3 / blt-for-STk-3.0 / blt-1.9 / src / bltGraph.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-19  |  19.8 KB  |  575 lines

  1. /*
  2.  * bltGraph.h --
  3.  *
  4.  * Copyright 1991-1994 by AT&T Bell Laboratories.
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for any purpose and without fee is hereby
  7.  * granted, provided that the above copyright notice appear in all
  8.  * copies and that both that the copyright notice and warranty
  9.  * disclaimer appear in supporting documentation, and that the
  10.  * names of AT&T Bell Laboratories any of their entities not be used
  11.  * in advertising or publicity pertaining to distribution of the
  12.  * software without specific, written prior permission.
  13.  *
  14.  * AT&T disclaims all warranties with regard to this software, including
  15.  * all implied warranties of merchantability and fitness.  In no event
  16.  * shall AT&T be liable for any special, indirect or consequential
  17.  * damages or any damages whatsoever resulting from loss of use, data
  18.  * or profits, whether in an action of contract, negligence or other
  19.  * tortuous action, arising out of or in connection with the use or
  20.  * performance of this software.
  21.  *
  22.  * Graph widget created by Sani Nassif and George Howlett.
  23.  */
  24.  
  25. #ifndef _GRAPH_H
  26. #define _GRAPH_H
  27.  
  28. #include <math.h>
  29. #ifdef HAVE_FLOAT_H
  30. #include <float.h>
  31. #endif
  32. #ifdef HAVE_LIMITS_H
  33. #include <limits.h>
  34. #endif
  35.  
  36. #if (TK_MINOR_VERSION > 0)
  37. #define Cursor Tk_Cursor
  38. #endif
  39.  
  40. /*
  41.  * ----------------------------------------------------------------------
  42.  *
  43.  * MAX_DBL_VALUE and MIN_DBL_VALUE are the largest and small values
  44.  * representable on the graph or barchart.  They are used for the
  45.  * following:
  46.  *
  47.  * 1. when searching for smallest or largest value of a set,
  48.  *    initialize current min/max to this.
  49.  *
  50.  * 2. represent tag coordinates "Inf" and "-Inf".
  51.  * ----------------------------------------------------------------------
  52.  */
  53. #ifdef HAVE_FLOAT_H
  54. #define MAX_DBL_VALUE     DBL_MAX
  55. #define MIN_DBL_VALUE    DBL_MIN
  56. #else
  57. /* Don't want to include __infinity (definition of HUGE_VAL (SC1.x)) */
  58. #ifdef sun
  59. #define MAX_DBL_VALUE    1.7976931348623157E+308
  60. #define MIN_DBL_VALUE     2.2250738585072014E-308
  61. #else
  62. /* Start to go into punt formation. */
  63. #ifdef HUGE_VAL
  64. #define MAX_DBL_VALUE   HUGE_VAL
  65. #define MIN_DBL_VALUE   (1/HUGE_VAL)
  66. #ifdef HUGE
  67. #define MAX_DBL_VALUE    HUGE
  68. #define MIN_DBL_VALUE    (1/HUGE)
  69. #else
  70. /* Punt: Assume something simple and relatively small */
  71. #define MAX_DBL_VALUE    3.40282347E+38
  72. #define MIN_DBL_VALUE     1.17549435E-38
  73. #endif /*HUGE*/
  74. #endif /*HUGE_VAL*/
  75. #endif /*sun*/
  76. #endif /*HAVE_FLOAT_H*/
  77.  
  78. #define MAX_POS_VAL    MAX_DBL_VALUE
  79. #define MAX_NEG_VAL    (-MAX_DBL_VALUE)
  80.  
  81. #undef BLT_MIN
  82. #define BLT_MIN(a,b)    (((a)<(b))?(a):(b))
  83.  
  84. #undef BLT_MAX
  85. #define BLT_MAX(a,b)    (((a)>(b))?(a):(b))
  86.  
  87. /*
  88.  * ------------------------------------------------------------------------
  89.  *
  90.  * Definitions of macros replacing math library functions, fabs, abs,
  91.  * rint, and exp10.
  92.  *
  93.  * Although many of these routines may be in your math library, they
  94.  * aren't used in libtcl.a or libtk.a.  This makes it impossible to
  95.  * load BLT library as a shared object without requiring that the math
  96.  * library be a shared object too.  We avoid the problem by replacing
  97.  * the "exotic" math routines with macros.
  98.  *
  99.  * ------------------------------------------------------------------------
  100.  */
  101. #undef BLT_FABS
  102. #define BLT_FABS(x)     (((x)<0.0)?(-(x)):(x))
  103.  
  104. #undef BLT_ABS
  105. #define BLT_ABS(x)     (((x)<0)?(-(x)):(x))
  106.  
  107. #undef BLT_RND
  108. #define BLT_RND(x)     ((int)((x) + (((x)<0.0) ? -0.5 : 0.5)))
  109.  
  110. #undef BLT_EXP10
  111. #define BLT_EXP10(x)    (pow(10.0,(x)))
  112.  
  113. #ifndef M_PI
  114. #define M_PI        3.14159265358979323846
  115. #endif /* M_PI */
  116.  
  117. #ifndef M_SQRT2
  118. #define M_SQRT2        1.41421356237309504880
  119. #endif /* M_SQRT1_2 */
  120.  
  121. #ifndef M_SQRT1_2
  122. #define M_SQRT1_2    0.70710678118654752440
  123. #endif /* M_SQRT1_2 */
  124.  
  125. #ifndef SHRT_MAX
  126. #define SHRT_MAX    0x7FFF
  127. #endif /* SHRT_MAX */
  128.  
  129. #define TRUE 1
  130. #define FALSE 0
  131.  
  132. /*
  133.  * Mask values used to selectively enable GRAPH or BARCHART entries in
  134.  * the various configuration specs.
  135.  */
  136. #define XYGRAPH_MASK    TK_CONFIG_USER_BIT
  137. #define BARCHART_MASK    TK_CONFIG_USER_BIT << 1
  138. #define ALL_MASK    (XYGRAPH_MASK | BARCHART_MASK)
  139. #define CONTOUR_MASK    TK_CONFIG_USER_BIT << 2
  140.  
  141. #define PADX        2    /* Padding between labels/titles */
  142. #define PADY        2    /* Padding between labels */
  143. #define TEXTHEIGHT(f)     ((f)->ascent + (f)->descent)
  144. #define DEF_POSITION     -SHRT_MAX    /* Indicates that no position was
  145.                      * specified */
  146.  
  147. /*
  148.  * -------------------------------------------------------------------
  149.  *
  150.  *     Graph component structure definitions
  151.  *
  152.  * -------------------------------------------------------------------
  153.  */
  154. typedef struct Graph Graph;
  155. typedef struct GraphAxis GraphAxis;
  156. typedef struct GraphLegend GraphLegend;
  157. typedef struct GraphPostScript GraphPostScript;
  158. typedef struct GraphCrosshairs GraphCrosshairs;
  159.  
  160. /*
  161.  * -------------------------------------------------------------------
  162.  *
  163.  * GraphClassType --
  164.  *
  165.  *    Enumerates the different types of graphs this program
  166.  *    produces. Currently, only one this of graph is allowed
  167.  *    on a single axis.
  168.  *
  169.  * -------------------------------------------------------------------
  170.  */
  171. typedef enum {
  172.     GRAPH, BARCHART, CONTOUR
  173. } GraphClassType;
  174.  
  175. /*
  176.  * -------------------------------------------------------------------
  177.  *
  178.  * TextAttributes --
  179.  *
  180.  *     Represents a convenience structure to hold text attributes
  181.  *    which determine how a text string is to be displayed on the
  182.  *    window, or drawn with PostScript commands.  The alternative
  183.  *    is to have drawing and printing routines with more parameters.
  184.  *     This seems like a more efficient and less cumbersome way.
  185.  *
  186.  * -------------------------------------------------------------------
  187.  */
  188. typedef struct {
  189.     char *text;            /* Text string to be displayed  */
  190.     XFontStruct *fontPtr;    /* Font to use for string */
  191.     XColor *bgColorPtr;        /* Background color of string */
  192.     XColor *fgColorPtr;        /* Foreground color of string */
  193.     Tk_Anchor anchor;        /* Anchor type: used to position the
  194.                  * string */
  195.     double theta;        /* Rotation of text in degrees. */
  196.     GC gc;            /* Graphics context to use when displaying
  197.                  * the string on the window */
  198. } TextAttributes;
  199.  
  200. /*
  201.  * -------------------------------------------------------------------
  202.  *
  203.  * AxisTypes --
  204.  *
  205.  *    Enumerated type representing the types of axes
  206.  *
  207.  * -------------------------------------------------------------------
  208.  */
  209. typedef enum AxisTypes {
  210.     X1_AXIS, Y1_AXIS, X2_AXIS, Y2_AXIS
  211. } AxisType;
  212.  
  213. #define AXIS_MASK(a)    (1<<((a)->type))
  214. #define X_AXIS(a)        (!((a)->type&1))
  215. #define Y_AXIS(a)    ((a)->type&1)
  216.  
  217. /* AxisFlags used by elements and tags */
  218. #define X1_AXIS_MASK    (1<<X1_AXIS)
  219. #define Y1_AXIS_MASK    (1<<Y1_AXIS)
  220. #define X2_AXIS_MASK    (1<<X2_AXIS)
  221. #define Y2_AXIS_MASK    (1<<Y2_AXIS)
  222.  
  223. #define STD_AXES_MASK    (X1_AXIS_MASK|Y1_AXIS_MASK)
  224. #define ANY_X_MASK    (X1_AXIS_MASK|X2_AXIS_MASK)
  225. #define ANY_Y_MASK    (Y1_AXIS_MASK|Y2_AXIS_MASK)
  226.  
  227. typedef enum AxisLocations {
  228.     BOTTOM_AXIS, LEFT_AXIS, TOP_AXIS, RIGHT_AXIS
  229. } AxisLocation;
  230.  
  231. /*
  232.  * -------------------------------------------------------------------
  233.  *
  234.  * GraphAxis --
  235.  *
  236.  *     Structure contains options controlling how the axis will be
  237.  *     displayed.
  238.  *
  239.  * -------------------------------------------------------------------
  240.  */
  241.  
  242. typedef void (AxisDisplayProc) _ANSI_ARGS_((Graph *graphPtr,
  243.     GraphAxis *axisPtr, TextAttributes * attrPtr));
  244. typedef void (AxisPrintProc) _ANSI_ARGS_((Graph *graphPtr, GraphAxis *axisPtr,
  245.     TextAttributes * attrPtr));
  246. typedef void (AxisLayoutProc) _ANSI_ARGS_((Graph *graphPtr,
  247.     GraphAxis *axisPtr));
  248. typedef void (AxisDestroyProc) _ANSI_ARGS_((Graph *graphPtr,
  249.     GraphAxis *axisPtr));
  250.  
  251. struct GraphAxis {
  252.     enum AxisTypes type;
  253.     enum AxisLocations location;/* Location of the axis: right, left, etc. */
  254.     int logScale;        /* If non-zero, scale values
  255.                  * logarithmically */
  256.     int mapped;            /* If non-zero, display the axis */
  257.  
  258.     AxisDisplayProc *displayProc;
  259.     AxisPrintProc *printProc;
  260.     AxisLayoutProc *layoutProc;
  261.     AxisDestroyProc *destroyProc;
  262. };
  263.  
  264. /*
  265.  * -------------------------------------------------------------------
  266.  *
  267.  * GraphLegend --
  268.  *
  269.  *     Contains information specific to how the legend will be
  270.  *    displayed.
  271.  *
  272.  * -------------------------------------------------------------------
  273.  */
  274.  
  275. typedef void (LegendDisplayProc) _ANSI_ARGS_((Graph *graphPtr));
  276. typedef void (LegendPrintProc) _ANSI_ARGS_((Graph *graphPtr));
  277. typedef void (LegendDestroyProc) _ANSI_ARGS_((Graph *graphPtr));
  278. typedef void (LegendGeometryProc) _ANSI_ARGS_((Graph *graphPtr, int height));
  279.  
  280. struct GraphLegend {
  281.     int mapped;            /* Requested state of the legend, If
  282.                  * non-zero, legend is displayed */
  283.     int width, height;        /* Dimensions of the legend */
  284.     XPoint anchorPos;        /* Window coordinates of legend
  285.                  * positioning point. Used in conjunction
  286.                  * with the anchor to determine the
  287.                  * location of the legend. */
  288.     int useDefault;        /* Draw the legend in the default location */
  289.  
  290.     LegendDisplayProc *displayProc;
  291.     LegendPrintProc *printProc;
  292.     LegendDestroyProc *destroyProc;
  293.     LegendGeometryProc *geomProc;
  294. };
  295.  
  296. /*
  297.  * -------------------------------------------------------------------
  298.  *
  299.  * GraphPostScript --
  300.  *
  301.  *     Structure contains information specific to the outputting of
  302.  *    PostScript commands to print the graph.
  303.  *
  304.  * -------------------------------------------------------------------
  305.  */
  306.  
  307. typedef int (PostScriptConfigureProc) _ANSI_ARGS_((Graph *graphPtr, int argc,
  308.     char **argv));
  309. typedef int (PostScriptPrintProc) _ANSI_ARGS_((Graph *graphPtr, int argc,
  310.     char **argv));
  311. typedef void (PostScriptDestroyProc) _ANSI_ARGS_((Graph *graphPtr));
  312.  
  313. struct GraphPostScript {
  314.     PostScriptConfigureProc *configProc;
  315.     PostScriptPrintProc *printProc;
  316.     PostScriptDestroyProc *destroyProc;
  317. };
  318.  
  319. /*
  320.  * -------------------------------------------------------------------
  321.  *
  322.  * GraphCrosshairs --
  323.  *
  324.  *    Contains the line segments positions and graphics context used
  325.  *    to simulate crosshairs (by XORing) on the graph.
  326.  *
  327.  * -------------------------------------------------------------------
  328.  */
  329. typedef void (CrosshairsToggleProc) _ANSI_ARGS_((Graph *graphPtr));
  330. typedef void (CrosshairsUpdateProc) _ANSI_ARGS_((Graph *graphPtr));
  331. typedef void (CrosshairsConfigProc) _ANSI_ARGS_((Graph *graphPtr));
  332. typedef void (CrosshairsDestroyProc) _ANSI_ARGS_((Graph *graphPtr));
  333.  
  334. struct GraphCrosshairs {
  335.     CrosshairsToggleProc *toggleProc;    /* Toggle visiblity of crosshairs */
  336.     CrosshairsUpdateProc *updateProc;    /* Update lengths of hairs */
  337.     CrosshairsConfigProc *configProc;    /* Configure GC */
  338.     CrosshairsDestroyProc *destroyProc;    /* Release X resources */
  339. };
  340.  
  341. /*
  342.  * -------------------------------------------------------------------
  343.  *
  344.  * Graph --
  345.  *
  346.  *    Top level structure containing everything pertaining to
  347.  *    the graph.
  348.  *
  349.  * -------------------------------------------------------------------
  350.  */
  351. struct Graph {
  352.     Tk_Window tkwin;        /* Window that embodies the graph.  NULL
  353.                  * means that the window has been
  354.                  * destroyed but the data structures
  355.                  * haven't yet been cleaned up. */
  356.     Pixmap canvas;        /* Pixmap for double buffering output */
  357.     Display *display;        /* Display containing widget; needed,
  358.                  * among other things, to release
  359.                  * resources after tkwin has already gone
  360.                  * away. */
  361.     char *pathName;        /* Pathname of the widget. Is saved here
  362.                  * in case the widget is destroyed and
  363.                  * tkwin become unavailable for querying
  364.                  * */
  365.     Tcl_Interp *interp;        /* Interpreter associated with graph */
  366.     GraphClassType type;    /* Type: either GRAPH or BARCHART */
  367.     unsigned int flags;        /* Flags;  see below for definitions. */
  368.  
  369.     GraphPostScript *postscript;/* PostScript options: see bltGrPS.c */
  370.     GraphLegend *legendPtr;    /* Legend information: see bltGrLegd.c */
  371.     GraphAxis *axisArr[4];    /* Coordinate axis info: see bltGrAxis.c */
  372.     GraphAxis *bottomAxis, *topAxis, *leftAxis, *rightAxis;
  373.     GraphCrosshairs *crosshairs;/* Crosshairs information: see
  374.                    bltGrHairs.c */
  375.     Tcl_HashTable elemTable;    /* Hash table containing all elements
  376.                  * created, not just those currently
  377.                  * displayed. */
  378.     Blt_LinkedList elemList;    /* Display list of elements */
  379.     Tcl_HashTable tagTable;    /* Hash table of tags */
  380.     Blt_LinkedList tagList;    /* Display list of tags */
  381.     unsigned int nextTagId;    /* Tracks next tag identifier available */
  382.  
  383.     int reqWidth, reqHeight;    /* Requested size of graph window */
  384.     int halo;            /* Maximum distance allowed between points
  385.                  * when searching for a point */
  386.     unsigned int buffered;    /* If non-zero, cache elements by drawing
  387.                  * them into a pixmap */
  388.     unsigned int inverted;    /* If non-zero, indicates the x and y axis
  389.                  * positions should be inverted. */
  390.     double barWidth;        /* Scale factor for the width of bar */
  391.  
  392.     int leftMargin;        /* Requested sizes for margins surrounding */
  393.     int rightMargin;        /* the plotting area. If non-zero, the */
  394.     int topMargin;        /* requested margin is used, otherwise the */
  395.     int bottomMargin;        /* computed margin sizes are used. */
  396.  
  397.     char *title;        /* Graph title */
  398.  
  399.     XFontStruct *fontPtr;    /* Font for graph and axis titles */
  400.     Cursor cursor;
  401.  
  402.     int borderWidth;        /* Width the exterior border */
  403.     int relief;            /* Relief of the exterior border */
  404.     Tk_3DBorder border;        /* 3-D border used to delineate the plot
  405.                  * surface and outer edge of window */
  406.     XColor *marginFg;        /* Foreground color of title and axis
  407.                  * labels */
  408.     int plotBW;            /* Width of interior 3-D border. */
  409.     int plotRelief;        /* 3-d effect: TK_RELIEF_RAISED etc. */
  410.     XColor *plotBg;        /* Color of plotting surface */
  411.  
  412.     GC plotFillGC;        /* GC to fill the plotting area with a
  413.                  * solid background color. The fill color
  414.                  * is stored in "plotBg". */
  415.     GC marginGC;        /* Graphics context for margin. Includes
  416.                  * margin background */
  417.     GC marginFillGC;        /* GC to fill the background of the
  418.                  * margins, clipping the plotting
  419.                  * area. The fill color is obtained
  420.                  * from "border". */
  421.  
  422.     double avgSymSize;        /* Average size of a symbol */
  423.  
  424.     int width, height;        /* Size of graph window or PostScript
  425.                  * page */
  426.     XPoint origin;        /* Origin of the graph */
  427.     XPoint extreme;        /* Outer limit of graph */
  428.  
  429.     Pixmap elemMap;        /* For double buffering the display of
  430.                  * graph elements */
  431.     unsigned int elemWidth;    /* Dimensions of element buffer pixmap */
  432.     unsigned int elemHeight;
  433.     char *scratchPtr;        /* Utility space for building strings.
  434.                  * Points to buffer of BUFSIZ bytes on
  435.                  * the stack.  Currently used to
  436.                  * create PostScript output for the
  437.                  * "postscript" command. */
  438.  
  439.  
  440. };
  441.  
  442. /*
  443.  * Flag bits for graphs:
  444.  */
  445.  
  446. #define    LAYOUT_NEEDED     (1<<0)    /* Indicates that one of the many
  447.                  * graph configurations has changed
  448.                  * (element, tag, axis, legend, etc)
  449.                  * and the layout of the graph
  450.                  * (position of the graph in the
  451.                  * window) needs to be recalculated. */
  452.  
  453. #define    LAYOUT_DIRTY    (1<<1)    /* Non-zero indicates that the layout
  454.                  * of the axes and all elements and
  455.                  * tags and the graph need to be
  456.                  * recalculated. Otherwise, the layout
  457.                  * of only those tags and elements that
  458.                  * have changed will be reset. */
  459.  
  460. #define    LAYOUT_ALL     (LAYOUT_NEEDED|LAYOUT_DIRTY)
  461.  
  462. #define REDRAW_PENDING     (1<<3)    /* Non-zero means a DoWhenIdle
  463.                  * handler has already been queued to
  464.                  * redraw this window. */
  465.  
  466. #define REFRESH        (1<<4)    /* Non-zero means that exterior
  467.                  * region of the graph, in addition to
  468.                  * the interior (plotting surface)
  469.                  * needs to be redrawn. The possible
  470.                  * reasons are:
  471.                  *
  472.                  * 1) an axis configuration changed
  473.                  *
  474.                  * 2) an axis limit changed
  475.                  *
  476.                  * 3) titles have changed
  477.                  *
  478.                  * 4) window was resized.
  479.                  */
  480.  
  481. #define LEGEND_ONLY    (1<<5)    /* Non-zero means that only the legend
  482.                  * need to be redrawn. In this case, the
  483.                  * legend display routine is called instead
  484.                  * of the graph display routine. */
  485.  
  486.  
  487. #define    DIRTY        (1<<6)    /* If set, redraw all elements into the
  488.                  * pixmap used for buffering elements. */
  489.  
  490. /*
  491.  * ---------------------- Forward declarations ------------------------
  492.  */
  493. extern Pixmap Blt_CreateTextBitmap _ANSI_ARGS_((Display * display,
  494.     Drawable draw, XFontStruct *fontPtr, char *textStr, double theta,
  495.     unsigned int *bmWPtr, unsigned int *bmHPtr));
  496. extern void Blt_DrawText _ANSI_ARGS_((Display * display, Drawable draw,
  497.     char *text, TextAttributes * attrPtr, int x, int y));
  498. extern void Blt_RedrawGraph _ANSI_ARGS_((Graph *graphPtr));
  499. extern void Blt_GetBoundingBox _ANSI_ARGS_((unsigned int width,
  500.     unsigned int height, double theta, unsigned int *widthPtr,
  501.     unsigned int *heightPtr, XPoint *pointArr));
  502. extern Pixmap Blt_RotateBitmap _ANSI_ARGS_((Display * display, Drawable draw,
  503.     GC gc, Pixmap bitmap, unsigned int width, unsigned int height,
  504.     double theta, unsigned int *rotWPtr, unsigned int *rotHPtr));
  505. extern void Blt_ComputeAxes _ANSI_ARGS_((Graph *graphPtr));
  506.  
  507. extern int Blt_Transform _ANSI_ARGS_((GraphAxis *axis, double value));
  508. extern double Blt_InvTransform _ANSI_ARGS_((GraphAxis *axis, int coord));
  509. extern XPoint Blt_TransformPt _ANSI_ARGS_((Graph *graphPtr, double x, double y,
  510.     unsigned int axisFlags));
  511. extern int Blt_TransformDist _ANSI_ARGS_((GraphAxis *axis, double value));
  512.  
  513. extern void Blt_StencilBitmap _ANSI_ARGS_((Display * display, Drawable draw,
  514.     GC gc, Pixmap bitmap, int x, int y, unsigned int width,
  515.     unsigned int height));
  516. extern unsigned int Blt_TextStringWidth _ANSI_ARGS_((XFontStruct *fontPtr,
  517.     char *text));
  518. extern XPoint Blt_TranslateBoxCoords _ANSI_ARGS_((int x, int y,
  519.     unsigned int width, unsigned int height, Tk_Anchor anchor));
  520. extern XPoint Blt_TranslateTextCoords _ANSI_ARGS_((XFontStruct *fontPtr,
  521.     char *text, int x, int y, Tk_Anchor anchor));
  522.  
  523. extern void Blt_PrintLine _ANSI_ARGS_((Graph *graphPtr, XPoint *pointArr,
  524.     int numPoints));
  525. extern void Blt_PrintBitmap _ANSI_ARGS_((Graph *graphPtr, Pixmap bitmap, int x,
  526.     int y, unsigned int width, unsigned int height));
  527. extern void Blt_SetLineAttributes _ANSI_ARGS_((Graph *graphPtr,
  528.     XColor *colorPtr, int lineWidth, int lineDashes));
  529. extern void Blt_3DRectangleToPostScript _ANSI_ARGS_((Graph *graphPtr,
  530.     Tk_3DBorder border, int x, int y, unsigned int width,
  531.     unsigned int height, int borderWidth, int relief));
  532. extern void Blt_BackgroundToPostScript _ANSI_ARGS_((Graph *graphPtr,
  533.     XColor *colorPtr));
  534. extern void Blt_BitmapToPostScript _ANSI_ARGS_((Graph *graphPtr, Pixmap bitmap,
  535.     int x, int y, unsigned int width, unsigned int height, double theta,
  536.     XColor *bgColorPtr));
  537. extern void Blt_FontToPostScript _ANSI_ARGS_((Graph *graphPtr,
  538.     XFontStruct *fontPtr));
  539. extern void Blt_ForegroundToPostScript _ANSI_ARGS_((Graph *graphPtr,
  540.     XColor *colorPtr));
  541. extern void Blt_LineDashesToPostScript _ANSI_ARGS_((Graph *graphPtr,
  542.     int lineDashes));
  543. extern void Blt_LineWidthToPostScript _ANSI_ARGS_((Graph *graphPtr,
  544.     int lineWidth));
  545. extern void Blt_LinesToPostScript _ANSI_ARGS_((Graph *graphPtr,
  546.     XPoint *pointArr, int numPoints));
  547. extern void Blt_PolygonToPostScript _ANSI_ARGS_((Graph *graphPtr,
  548.     XPoint *pointArr, int numPoints));
  549. extern void Blt_Print3DRectangle _ANSI_ARGS_((Graph *graphPtr,
  550.     Tk_3DBorder border, int x, int y, unsigned int width,
  551.     unsigned int height, int borderWidth, int relief));
  552. extern void Blt_RectangleToPostScript _ANSI_ARGS_((Graph *graphPtr,
  553.     int x, int y, unsigned int width, unsigned int height));
  554. extern void Blt_RectanglesToPostScript _ANSI_ARGS_((Graph *graphPtr,
  555.     XRectangle *rectArr, int numRects));
  556. extern void Blt_SegmentsToPostScript _ANSI_ARGS_((Graph *graphPtr,
  557.     XSegment *segArr, int numSegs));
  558. extern void Blt_StippleToPostScript _ANSI_ARGS_((Graph *graphPtr,
  559.     Pixmap bitmap, unsigned int width, unsigned int height, int fgOrBg));
  560. extern void Blt_TextToPostScript _ANSI_ARGS_((Graph *graphPtr, char *text,
  561.     TextAttributes * attrPtr, int x, int y));
  562. extern int Blt_GetTokenIndex _ANSI_ARGS_((char **list, char *key, int flag));
  563. #if (TK_MINOR_VERSION > 0)
  564. extern int Blt_OptionChanged _ANSI_ARGS_(TCL_VARARGS(Tk_ConfigSpec *,specs));
  565. #else
  566. extern int Blt_OptionChanged _ANSI_ARGS_(VARARGS(Tk_ConfigSpec *specs));
  567. #endif
  568.  
  569. /*
  570.  * ---------------------- Global declarations ------------------------
  571.  */
  572. extern double Blt_negInfinity, Blt_posInfinity;
  573.  
  574. #endif /* _GRAPH_H */
  575.